package input;

import java.awt.event.MouseEvent;

import javax.swing.event.MouseInputAdapter;

/**
 * Recebe todos os inputs e manda para o input manager.
 * Nen public nen private, vista apenas no pacote.
 * @author Ygor
 *
 */
class MouseListener extends MouseInputAdapter {

	@Override
	public void mousePressed(MouseEvent e) {
		switch (e.getButton()) {
		case MouseEvent.BUTTON1:
			InputManager.mouse.leftButton.toogle(true);
			break;
		case MouseEvent.BUTTON2:
			InputManager.mouse.middleButton.toogle(true);
			break;
		case MouseEvent.BUTTON3:
			InputManager.mouse.rightButton.toogle(true);
			break;
		}
		
		
		System.out.println(e.getX() + " " + e.getY());
	}
	@Override
	public void mouseReleased(MouseEvent e) {
		switch (e.getButton()) {
		case MouseEvent.BUTTON1:
			InputManager.mouse.leftButton.toogle(false);
			break;
		case MouseEvent.BUTTON2:
			InputManager.mouse.middleButton.toogle(false);
			break;
		case MouseEvent.BUTTON3:
			InputManager.mouse.rightButton.toogle(false);
			break;
		}
	}
}
